The present invention relates to the processing of video sequences, and more particularly to a robust, accurate and computationally inexpensive method of estimating camera motion for a wide range of video sequences.
A number of different video processing applications depend upon an accurate estimate of camera motion, i.e., the movement of the camera relative to a scene while a video sequence is being recorded or shot. The camera motion parameters typically required are pan (horizontal movement), tilt (vertical movement), zoom (depth movement) and rotation. In most situations this information is not explicitly available and needs to be calculated by processing the video sequence. Once knowledge of the camera motion is obtained, then compensation may be performed, enabling the extraction of objects and the calculation of true object motion within the scene. The number of applications that may make use of such a camera motion model is continually growing and includes video compression, object tracking, scene analysis and foreground/background detection.
A number of camera motion estimation techniques have been proposed in the technical literature. However all of these techniques contain a number of deficiencies. Some models only produce a three parameter estimate of camera motion and therefore fail whenever the camera undergoes any rotational motion. The method described in xe2x80x9cA Fast Algorithm for Detection of Camera Motionxe2x80x9d by H. Kim et al, Proceedings SPIE 3303-Real-time Imaging III, San Jose, USA, pp. 78-87, January 1998 provides an indication of whether or not camera motion is present, but fails to give a quantitative estimate of the magnitude of the motion. Other models use an 8-parameter model that is both exceedingly computationally expensive and provides more parameters than are necessary for the types of applications mentioned above. Some models rely on the use of Motion Picture Engineering Group (MPEG) motion vectors (MVs) as inputs. However this causes a number of problems: (a) the MVs are not available for I frames and also for many macroblocks in P and B frames; and (b) standard block-based MVs are very noisy and often differ significantly from the true object motion.
Most camera motion models converge to an estimate of the camera motion parameters in an iterative manner. In this approach MVs of objects that do not conform to the global camera motion model, i.e., foreground and moving objects, are iteratively removed and a new estimate of the camera motion parameters is calculated using only the remaining objects. This process is crucial to the overall accuracy and robustness of the model. Local motion estimates may be very noisy in areas of low spatial detail in the scene and therefore should not be used. Of the other models found in the literature only the model described in xe2x80x9cOn Using Raw MPEG Motion Vectors to Determine Global Camera Motionxe2x80x9d by M. Pilu, Proceedings SPIE 3309-Visual Communications and Image Processing, San Jose, USA, pp. 448-459, January 1998 performs a similar removal of MVs in areas of low spatial detail. Another shortcoming of previous models is the choice of the starting values for the camera motion parameters during the iteration process. The previous models use the values found from a Least Squares (LS) estimate during the first iteration. This works fine for video where the background dominates the scene. However in video with strong foreground motion this initial estimate may be inaccurate and may result in the model converging to an incorrect estimate of camera motion. Finally previous models do not have a mechanism for handling video that has temporal repetition, such as frame repeat or 3:2 pulldown.
What is desired is a robust camera motion estimation method for video sequences that is accurate and computationally inexpensive.
Accordingly the present invention provides a robust camera motion estimation method for video sequences that calculates from a current and previous frame of the video sequence motion vectors for the current frame using a multi-scale block matching technique. The means of the motion vectors for the current and previous frames are compared to detect temporal discontinuities, the detection of which ends the processing of the current frame and, when the discontinuity is a temporal repetition such as frozen frame or 3:2 pulldown, uses the camera motion parameters from the previous frame for the current frame. Otherwise motion vectors for spatially flat areas and text/graphic overlay areas are removed and an error-of-fit for the previous frame is tested to determine what initial estimate to use for camera motion parameters in an iterative estimation process. If the error-of-fit is less than a predetermined threshold, then the previous frame""s camera motion parameters are used as the initial estimate, otherwise a least squares best fit is used. Outlier motion vectors are removed and the camera motion parameters are calculated in the iterative estimation process until either the error-of-fit is less than the predetermined threshold or the number of iterations has exceeded a maximum. The outputs are the estimated camera motion parameters and the associated error-of-fit.
The objects, advantages and other novel features of the present invention are apparent from the following detailed description when read in conjunction with the appended claims and attached drawing.